var uid = sessionStorage.getItem("u_group_no");
$(function () {
	var paramJson = { "actName": "GetOrderM", "rows": "", "page": "", "utype": "5", "uid": uid, "bdate": "", "edate":"", "rand": Math.random() };
	ajaxGet("http://zz.nxk520.com/nethosp/service/nethosp_action.ashx", paramJson, doOk);
	/* GetPageData('获取所有处方信息', { "actName": "actPatient", "actTag": "Indent_list", "take_type": 2, "group_no": uid }, showOrderList); */
	/* 参数："actName": "GetOrderM",rows分页行数,page页码,bdate开始日期,edate结束日期 */

	/* 处方列表点击事件 */
	$("#shop_prescription_list").on("click", "a", function(){
		var prescription_id = $(this).attr("data-Pid");
		var indent_no = $(this).attr("data-Iid");
		window.location.href = "shop_prescription_details.html?prescription_id="+prescription_id+"&indent_no="+indent_no;
	});
});

    function doOk(rstData) {
        if (rstData.list.length > 0) {
        	//生成html片段
        	var html = template("shopPrescriptionList",rstData);
        	var container = document.getElementById("shop_prescription_list");
        	//将html片段渲染到界面中
        	container.innerHTML = html;
        }
        else{
        	//生成html片段
        	var html = template("noData",rstData);
        	var container = document.getElementById("shop_prescription_list");
        	//将html片段渲染到界面中
        	container.innerHTML = html;
        }
    }


    function actSelPage(obj) {
        var url = "shop_rx_dtl9.htm?rx_num=" + obj.trim() + "&rand=" + Math.random;
        location.href = url;
    }